var table,$;
layui.use(['table'],function () {
    table = layui.table;
    $ = layui.$;
    initDeliveryData();
    $("#search").click(function () {
        initDeliveryData();
    })
    table.on('toolbar(deliveryList)', function(obj){
        // var checkStatus = table.checkStatus(obj.config.id);
        switch(obj.event){
            case 'add':
                layer.msg('添加');
                break;
            case 'delete':
                layer.msg('删除');
                break;
            case 'update':
                layer.msg('编辑');
                break;
        };
    });
})

function initDeliveryData() {
    var uniqueId = $('#uniqueId').val();
    var assoId = $('#assoId').val();

    if (assoId == "") {
        assoId = 0;
    }
    table.render({
        elem: '#deliveryList'
        , url: '/zpxx/getDelivery'
        , method: 'get'
        , where: {
            uniqueId: uniqueId,
            assoId:assoId
        }
        , limit: 10
        , page: true
        , toolbar: 'default'
        , cols: [[
            {type: 'numbers'}
            , {field: 'id', title: 'ID', width: 80, unresize: true, sort: true}
            , {field: 'assoId', title: '社团ID', width: 80,unresize: true,}
            , {field: 'zpxxId', title: '招聘信息ID', width: 110,unresize: true,}
            , {field: 'depName', title: '应聘部门'}
            , {field: 'uniqueId', title: '用户号'}
            , {field: 'vitaeId', title: '简历ID', width: 80,unresize: true,}
            , {field: 'code', title: '投递状态'}
        ]]
    })
}